package com.example.domain;



import com.google.gson.annotations.Expose;

import java.util.*;

/**
 * DTO类，用来存放聊天的消息
 * @author BoBo
 *
 */
public class Message {

	//发送者
	@Expose
	private String from;
	//接收者
	@Expose
	private String to;
	//发送的文本
	@Expose
	private String text;
	
	//在线用户列表
	@Expose
	private Set<String> userSet = new HashSet<>();
	public Message(){};

	public Message(String from, String to, String text, Set<String> set) {
		this.from = from;
		this.to = to;
		this.text = text;
		this.userSet = set;
	}

	public String getFrom() {
		return from;
	}

	public void setFrom(String from) {
		this.from = from;
	}

	public String getTo() {
		return to;
	}

	public void setTo(String to) {
		this.to = to;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	public Set<String> getSet() {
		return userSet;
	}

	public void setSet(Set<String> set) {
		this.userSet = set;
	}

	@Override
	public String toString() {
		return "Message{" +
				"from='" + from + '\'' +
				", to='" + to + '\'' +
				", text='" + text + '\'' +
				", userSet=" + userSet +
				'}';
	}
}
